import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SalesmanForm, SalesmanQuery, SalesmanVO } from './types';

/**
 * 查询业务员列表
 * @param query
 */
export const channelSalesmanList = (query: SalesmanQuery): AxiosPromise<SalesmanVO[]> => {
  return request({
    url: '/payment/channelSalesman/list',
    method: 'get',
    params: query
  });
};

/**
 * 新增业务员
 */
export const addSalesman = (data: SalesmanForm) => {
  return request({
    url: '/payment/channelSalesman',
    method: 'post',
    params: data
  });
};

/**
 * 修改业务员
 */
export const updateSalesman = (data: SalesmanForm) => {
  return request({
    url: '/payment/channelSalesman',
    method: 'put',
    params: data
  });
};



export default {
  channelSalesmanList,
  addSalesman,
  updateSalesman,

};
